﻿using Architecture.Api.Application.Commands.DeepProcessingCommand;
using Architecture.Domain.Services.Interface;
using Architecture.Domain.TraceabilityManage;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.DeepProcessingHandler
{
    public class DeepProcessingQueryCommandHandler : IRequestHandler<DeepProcessingQueryCommand, DeepProcessing>
    {
        private readonly IDeepProcessingService _deepProcessingService;

        public DeepProcessingQueryCommandHandler(
            IDeepProcessingService deepProcessingService)
        {
            _deepProcessingService = deepProcessingService;
        }

        public async Task<DeepProcessing> Handle(DeepProcessingQueryCommand request, CancellationToken cancellationToken)
        {
            return await _deepProcessingService.GetDeepProcessingInfo(request.productionLot);
        }
    }
}